package com.shadow.cloud.common.constants;

/**
 * 系统级常量
 *
 */
public final class SysConstants {

    private SysConstants() {
    }

    /**
     * 系统运行时异常返回
     */
    public static final String SYS_EXCEPTION_HANDLER_RESULT = "error";
    /**
     * 健康检查返回
     *  向曾经得【兰德】致敬
     */
    public static final String HEALTH_RESULT = "I'm alive...";

    /**
     * 分隔符相关.
     **/
    public static final String SPLIT_COMMA                  = ",";   // 逗号
    public static final String SPLIT_SEMICOLON              = ";";   // 分号
    public static final String SPLIT_EQUAL                  = "=";   // 等于
    public static final String SPLIT_UNDERLINE              = "_";   // 下划线分
    public static final String SPLIT_AND_JOIN               = "&";   // 与
    public static final String SPLIT_DASH                   = "-";   // 横杠
    public static final String SPLIT_COLON                  = ":";   // 冒号
    public static final String SPLIT_SLASH                  = "/";   // 斜杠
    public static final String SPLIT_VERTICAL_LINE          = "|";   // 垂直线
    public static final String SPLIT_TILDE                  = "~";   // 波浪号
    public static final String SPLIT_QUESTION_MARK          = "?";   // 问号
    public static final String SPLIT_POINT_POINT            = "\\."; // 点
    public static final String SPLIT_VERTICAL_LINE_ESCAPE   = "\\|"; // 竖线
    public static final String SPLIT_SYMBOL                 = "@";   // 艾特

    //时间格式
    public static final String PATTERN_HMS_DAWN = " 00:00:00";
    public static final String PATTERN_HMS_VAL = " 23:59:59";

    /* 字符集 */
    public static final String UTF8 = "UTF-8";
    public static final String GBK = "GBK";


    /* 数据字典顶级id */
    public static final String PARENT_ID = "0";
    /** 上级字典编码属性. **/
    public static final String PARENT_ID_STRING = "parent_id";
    /** 缓存超时时间. **/
    public static final Long NEVER_TIME_OUT = 0L;



    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 限流 redis key
     */
    public static final String RATE_LIMIT_KEY = "rate_limit:";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 令牌
     */
    public static final String TOKEN = "token";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_USER_KEY = "login_user_key";

    /**
     * 用户ID
     */
    public static final String JWT_USERID = "userid";


    /**
     * 用户头像
     */
    public static final String JWT_AVATAR = "avatar";

    /**
     * 创建时间
     */
    public static final String JWT_CREATED = "created";


    /**
     * RMI 远程方法调用
     */
    public static final String LOOKUP_RMI = "rmi://";

    /**
     * LDAP 远程方法调用
     */
    public static final String LOOKUP_LDAP = "ldap://";
}
